<div id="headerArea">
  <div id="header">
  	<img src="<%= Skyline::Configuration.skyline_logo %>" alt="" height="19"/>

    <div id="usernavigation">
      <%= t(:logged_in_as, :user => h(current_user.display_name), :scope => [:authentication]).html_safe  %>
      (<%= link_to t(:link, :scope => [:user, :profile]), edit_skyline_profile_path, :remote => true %> |
      <%= link_to t(:logout, :scope => [:authentication]), skyline_authentication_path, :method => :delete %>)
    </div>
  </div>

  <div id="mainnavigation">

  	<% if Skyline::Configuration.custom_logo %>
  	  <img src="<%= Skyline::Configuration.url_prefix %>/images/logo.png" alt="powered by Skyline"  style="position: absolute; right: 10px; top: 5px"/>
  	<% end %>
    <ul>
      <% if Skyline::Configuration.enable_pages && current_user.allow?("page_index") %>
        <li>
          <%= link_to t(:pages, :scope => [:navigation,:mainnavigation]), skyline_articles_path(:type => Skyline::Page), :class => (current_menu_item == :pages ? "active" : nil) %>
        </li>
      <% end %>
      <% if (Skyline::Configuration.articles + Skyline::Configuration.content_classes).any? %>
        <li>
          <%= link_to t(:content_library, :scope => [:navigation,:mainnavigation]), {:controller => "/skyline/content", :action => "index"}, :class => (current_menu_item == :content_library ? "active" : nil) %>
        </li>
      <% end %>
      <% if current_user.allow?("media_file_show") %>
        <li>
          <%= link_to t(:media_library, :scope => [:navigation,:mainnavigation]), skyline_media_dirs_path, :class => (current_menu_item == :media_library ? "active" : nil) %>
        </li>
      <% end %>
      <% if (current_user.allow?(:settings_update) && Skyline::Content::Implementation.instance.has_settings?) || (current_user.allow?(:user_show) && Skyline::Configuration.user_class == Skyline::User) %>
        <li class="has-children">
          <span <%= 'class="active"'.html_safe if current_menu_item == :admin %>><%= t(:admin, :scope => [:navigation,:mainnavigation]) %></span>
          <ul>
            <% if current_user.allow?(:settings_update) && Skyline::Content::Implementation.instance.has_settings? %>
              <li><%= link_to t(:settings, :scope => [:navigation,:mainnavigation]), skyline_settings_path %></li>
            <% end %>
            <% if current_user.allow?(:user_show) && Skyline::Configuration.user_class == Skyline::User %>
              <li><%= link_to t(:users, :scope => [:navigation,:mainnavigation]), skyline_users_path %></li>
            <% end %>
            <% plugin_hook :admin_submenu %>
          </ul>
        </li>
      <% end %>
    </ul>
  </div>
  <script type="text/javascript" charset="utf-8">
    var m = new Skyline.Menu($('mainnavigation').getElement("ul"));
  </script>
</div>
<div id="messageArea">
</div>
